package com.noahplat.user.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 用户账套表
 *
 * @author 李东
 * @version 1.0.0
 * @Date: 2021/2/24 15:48
 **/
@Data
@Table(name = "tb_account")
public class Account {

    @Id
    private Long id;

    @NotNull(message = "参数不能为null")
    @Length(max = 32, message = "长度不能超过32位")
    private String acctname; //账套名称 账套名称

    @Length(max = 1, message = "长度不能超过1位")
    private String status = "Y"; //账套状态 账套状态：Y-正常；N-停用

    @NotNull(message = "参数不能为null")
    @Length(max = 32, message = "长度不能超过32位")
    @Column(name = "created_by")
    private String createdBy; //创建人 账套创建人

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "created_time")
    private Date createdTime; //创建时间 账套创建时间

    @Transient
    private Long uid;

}
